package com.fh.shop.admin.util;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtils {
    public static final String Y_M_D = "yyyy-MM-dd";
    public static final String Y_M_D_H_M_S = "yyyy-MM-dd HH:mm:ss";

    public static String date2str(Date date,String pattern){
        if (date == null){
            return "";
        }
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);
        String res = sdf.format(date);
        return res;
    }
}
